from django.db.models import Lookup, Field


class EggEgg(Lookup):
    lookup_name = "ee"

    def as_sql(self, compiler, connection):
        lhs, lhs_params = self.process_lhs(compiler, connection)
        rhs, rhs_params = self.process_rhs(compiler, connection)
        params = lhs_params + rhs_params
        print(lhs, rhs, params)
        sql = ('%s = %s' % (lhs, rhs), params)

        return "ABS(%s) = %s" %(lhs, rhs), params


Field.register_lookup(EggEgg)
